import Vue from 'vue'
const currentStep = {
  state: {
    steps: {},
    clickFlag: false,
    fieldFlag: false,  //表单设计字段重复校验状态值
  },
  mutations: {
    UP: (state, payload) => {
      Vue.set(state.steps, payload.key, payload.value)
    },
    DOWN: (state, payload) => {
      Vue.set(state.steps, payload.key, payload.value)
    },
    CHANGE_STEPS: (state, payload) => {
      Vue.set(state.steps, payload.key, payload.value)
    },
    CHANGE_FLAG: (state, payload) => {
        state.clickFlag = payload
    },
    CHANGE_FIELD: (state, payload) => {
      state.fieldFlag = payload
  },
  },
  actions: {
    up({ commit }, data) {
      commit('UP', data)
    },
    down({ commit }, data) {
      commit('DOWN', data)
    },
    changeSteps({ commit }, data) {
      commit('CHANGE_STEPS', data)
    },
    changeFlag({ commit }, data) {
      commit('CHANGE_FLAG', data)
    },
    changeField({ commit }, data) {
      commit('CHANGE_FIELD', data)
    },
  }
}

export default currentStep